<?php
declare (strict_types = 1);
namespace app\index\middleware;
use app\common\service\Token;

class JWTTokenCheck
{
    public function handle($request, \Closure $next)
    {
       
    //    $test=$request->param();
    //    $test['msg']=1;
    //    $request->params=$test;
    //     dump($request->params);
       
        $accessToken = $request->header('Token');
        if(!$accessToken)
            return fail('','token为空');
       // return  show('', 400); 
        $jwttoken=new Token;
        return $jwttoken->chekToken($accessToken);

        return $next($request);
    }
}

